package com.ulook.planetmanager.util.net;

/**
 * 描述：封装回调接口和要转换的实体对象
 *
 * @author: L1998
 * @data: 2021/3/24
 */

public class ResposeDataHandle {

    public ResponseCallback mListener = null;
    public Class<?> mClass = null;

    public ResposeDataHandle(ResponseCallback listener) {
        if(listener == null){
            listener = new ResponseCallback() {
                @Override
                public void onSuccess(Object res) {
                    return;
                }
                @Override
                public void onFailure(OkHttpException failuer) {
                    return;
                }
            };
        }
        this.mListener = listener;
    }

    public ResposeDataHandle(ResponseCallback listener, Class<?> clazz) {
        if(listener == null){
            listener = new ResponseCallback() {
                @Override
                public void onSuccess(Object res) {
                    return;
                }
                @Override
                public void onFailure(OkHttpException failuer) {
                    return;
                }
            };
        }
        this.mListener = listener;
        this.mClass = clazz;
    }
    
}
